package com.bed.lovewithpatientbed.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * dealer
 * @author 
 */
public class Dealer implements Serializable {
    private Integer dealerId;

    private Integer hospitalManagerId;

    private String dealerName;

    private String dealerPhone;

    private Integer workerMessageId;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date dealerRegDate;

    private Integer softdel;

    private HospitalManager hospitalManager;

    private WorkerMessage workerMessage;

    private Role role;

    public Role getRole() {
        return role;
    }

    public void setRole(Role role) {
        this.role = role;
    }

    public WorkerMessage getWorkerMessage() {
        return workerMessage;
    }

    public void setWorkerMessage(WorkerMessage workerMessage) {
        this.workerMessage = workerMessage;
    }

    public HospitalManager getHospitalManager() {
        return hospitalManager;
    }

    public void setHospitalManager(HospitalManager hospitalManager) {
        this.hospitalManager = hospitalManager;
    }

    private static final long serialVersionUID = 1L;

    public Integer getDealerId() {
        return dealerId;
    }

    public void setDealerId(Integer dealerId) {
        this.dealerId = dealerId;
    }

    public Integer getHospitalManagerId() {
        return hospitalManagerId;
    }

    public void setHospitalManagerId(Integer hospitalManagerId) {
        this.hospitalManagerId = hospitalManagerId;
    }

    public String getDealerName() {
        return dealerName;
    }

    public void setDealerName(String dealerName) {
        this.dealerName = dealerName;
    }

    public String getDealerPhone() {
        return dealerPhone;
    }

    public void setDealerPhone(String dealerPhone) {
        this.dealerPhone = dealerPhone;
    }

    public Integer getWorkerMessageId() {
        return workerMessageId;
    }

    public void setWorkerMessageId(Integer workerMessageId) {
        this.workerMessageId = workerMessageId;
    }

    public Date getDealerRegDate() {
        return dealerRegDate;
    }

    public void setDealerRegDate(Date dealerRegDate) {
        this.dealerRegDate = dealerRegDate;
    }

    public Integer getSoftdel() {
        return softdel;
    }

    public void setSoftdel(Integer softdel) {
        this.softdel = softdel;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Dealer other = (Dealer) that;
        return (this.getDealerId() == null ? other.getDealerId() == null : this.getDealerId().equals(other.getDealerId()))
            && (this.getHospitalManagerId() == null ? other.getHospitalManagerId() == null : this.getHospitalManagerId().equals(other.getHospitalManagerId()))
            && (this.getDealerName() == null ? other.getDealerName() == null : this.getDealerName().equals(other.getDealerName()))
            && (this.getDealerPhone() == null ? other.getDealerPhone() == null : this.getDealerPhone().equals(other.getDealerPhone()))
            && (this.getWorkerMessageId() == null ? other.getWorkerMessageId() == null : this.getWorkerMessageId().equals(other.getWorkerMessageId()))
            && (this.getDealerRegDate() == null ? other.getDealerRegDate() == null : this.getDealerRegDate().equals(other.getDealerRegDate()))
            && (this.getSoftdel() == null ? other.getSoftdel() == null : this.getSoftdel().equals(other.getSoftdel()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getDealerId() == null) ? 0 : getDealerId().hashCode());
        result = prime * result + ((getHospitalManagerId() == null) ? 0 : getHospitalManagerId().hashCode());
        result = prime * result + ((getDealerName() == null) ? 0 : getDealerName().hashCode());
        result = prime * result + ((getDealerPhone() == null) ? 0 : getDealerPhone().hashCode());
        result = prime * result + ((getWorkerMessageId() == null) ? 0 : getWorkerMessageId().hashCode());
        result = prime * result + ((getDealerRegDate() == null) ? 0 : getDealerRegDate().hashCode());
        result = prime * result + ((getSoftdel() == null) ? 0 : getSoftdel().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", dealerId=").append(dealerId);
        sb.append(", hospitalManagerId=").append(hospitalManagerId);
        sb.append(", dealerName=").append(dealerName);
        sb.append(", dealerPhone=").append(dealerPhone);
        sb.append(", workerMessageId=").append(workerMessageId);
        sb.append(", dealerRegDate=").append(dealerRegDate);
        sb.append(", softdel=").append(softdel);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}